package com.bw.android.bwgao6week2a;

import android.widget.ImageView;

import androidx.databinding.BindingAdapter;

import com.bumptech.glide.Glide;

/**
 * Author: conghao
 * Date: 2023/9/21 10:47
 * Description: DataBinding自定义绑定适配器
 */
public class MyBindingAdapter {
    @BindingAdapter({"app:imgUrl", "app:placeholder"})
    public static void setImageUrl(ImageView imageView, String src, int holder) {
        Glide.with(imageView)
                .load(src)
                .placeholder(holder)
                .error(R.mipmap.ic_launcher)
                .into(imageView);

    }
}
